﻿using SLClient.CustomerControls;
using SLClient.Extension;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;

namespace SLClient.Views
{
    public partial class NxsscView : Page
    {
        public int lotteryCatagoryId;

        public NxsscView()
        {
            PlayDataInfo sscData;
            this.lotteryCatagoryId = 3;
            this.InitializeComponent();
            if (!IsolatedStorageHelper<PlayDataInfo>.IsSettingPersisted("ssc"))
            {
                sscData = new PlayDataInfo(this.lotteryCatagoryId, "ssc");
            }
            else if (ViewDispatcher.SscData.CurrentPlayData.OpenTime <= DateTime.Now)
            {
                sscData = new PlayDataInfo(this.lotteryCatagoryId, "ssc");
            }
            else
            {
                sscData = ViewDispatcher.SscData;
            }
            BonusControl bonuscontrol = new BonusControl(sscData);
            this.gridUp.Children.Add(bonuscontrol);
            bonuscontrol.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)0);
            bonuscontrol.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            LastOpenDataControl control2 = new LastOpenDataControl(sscData);
            this.gridUp.Children.Add(control2);
            control2.SetValue(Grid.ColumnProperty, 1);
            control2.SetValue(FrameworkElement.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
            Top10WinnerControl control3 = new Top10WinnerControl(sscData);
            this.gridDown.Children.Add(control3);
            control3.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)2);
            control3.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            control3.SetValue(Grid.ColumnProperty, 1);
            this.m_BetControl.InitPage(new string[] { "万位", "千位", "百位", "十位", "个位" }, new BetPlayTypeInfo[] { new BetPlayTypeInfo(0x11, "不定位", new BetPlayInfo[] { new BetPlayInfo(0x3a, "后一", 2, 1, 1, 4, false), new BetPlayInfo(60, "后二", 2, 1, 1, 3, false), new BetPlayInfo(0x3d, "后三", 2, 1, 1, 2, false), new BetPlayInfo(0x3e, "五星", 2, 1, 1, 0, false) }) }, bonuscontrol, this.lotteryCatagoryId);
        }
    }
}
